using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using C1.Win.C1List;
using PCSComMaterials.Plan.BO;
using PCSComMaterials.Plan.DS;
using PCSComUtils.Common;
using PCSComUtils.Common.BO;
using PCSComUtils.PCSExc;
using PCSUtils.Log;
using PCSUtils.Utils;

namespace PCSMaterials.Mrp
{
	/// <summary>
	/// Summary description for MRPRegenerationProcess.
	/// </summary>
	public class MRPRegenerationProcess : Form
	{
		private Button btnClose;
		private Button btnHelp;
		private Label lblCycle;
		private Label lblCCN;
		private Button btnPreviewCycle;
		private Button btnProcess;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private Container components = null;
		private C1Combo cboCCN;
		private TextBox txtCycle;
		private Button btnCycle;
		private PictureBox ptbImage;
		private DateTime dtmAsOfDate;
		private int intPlanHorizon = 0;
		private int intMRPCycleOptionMasterID = 0;
		private Thread thrNewGen;
		private Label lblVendor;
		private Label lblCategory;
		private Label lblModel;
		private Label lblPartNumber;
		private Label lblPartName;
		private TextBox txtVendor;
		private Button btnVendor;
		private TextBox txtCategory;
		private Button btnCategory;
		private TextBox txtModel;
		private Button btnModel;
		private TextBox txtPartNumber;
		private Button btnPartNumber;
		private TextBox txtPartName;
		private Button btnPartName;
		private const string THIS = "PCSMaterials.Mrp.MRPRegenerationProcess";
		private const string MODEL_VIEW = "v_ModelList";
		public MRPRegenerationProcess()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		public MRPRegenerationProcess(int pintMRPCycleOptionMasterID)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
			intMRPCycleOptionMasterID = pintMRPCycleOptionMasterID;
		}	
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MRPRegenerationProcess));
			this.btnClose = new System.Windows.Forms.Button();
			this.btnHelp = new System.Windows.Forms.Button();
			this.lblCycle = new System.Windows.Forms.Label();
			this.lblCCN = new System.Windows.Forms.Label();
			this.btnPreviewCycle = new System.Windows.Forms.Button();
			this.btnProcess = new System.Windows.Forms.Button();
			this.cboCCN = new C1.Win.C1List.C1Combo();
			this.txtCycle = new System.Windows.Forms.TextBox();
			this.btnCycle = new System.Windows.Forms.Button();
			this.ptbImage = new System.Windows.Forms.PictureBox();
			this.lblVendor = new System.Windows.Forms.Label();
			this.lblCategory = new System.Windows.Forms.Label();
			this.lblModel = new System.Windows.Forms.Label();
			this.lblPartNumber = new System.Windows.Forms.Label();
			this.lblPartName = new System.Windows.Forms.Label();
			this.txtVendor = new System.Windows.Forms.TextBox();
			this.btnVendor = new System.Windows.Forms.Button();
			this.txtCategory = new System.Windows.Forms.TextBox();
			this.btnCategory = new System.Windows.Forms.Button();
			this.txtModel = new System.Windows.Forms.TextBox();
			this.btnModel = new System.Windows.Forms.Button();
			this.txtPartNumber = new System.Windows.Forms.TextBox();
			this.btnPartNumber = new System.Windows.Forms.Button();
			this.txtPartName = new System.Windows.Forms.TextBox();
			this.btnPartName = new System.Windows.Forms.Button();
			((System.ComponentModel.ISupportInitialize)(this.cboCCN)).BeginInit();
			this.SuspendLayout();
			// 
			// btnClose
			// 
			this.btnClose.AccessibleDescription = resources.GetString("btnClose.AccessibleDescription");
			this.btnClose.AccessibleName = resources.GetString("btnClose.AccessibleName");
			this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnClose.Anchor")));
			this.btnClose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnClose.BackgroundImage")));
			this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.btnClose.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnClose.Dock")));
			this.btnClose.Enabled = ((bool)(resources.GetObject("btnClose.Enabled")));
			this.btnClose.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnClose.FlatStyle")));
			this.btnClose.Font = ((System.Drawing.Font)(resources.GetObject("btnClose.Font")));
			this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
			this.btnClose.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.ImageAlign")));
			this.btnClose.ImageIndex = ((int)(resources.GetObject("btnClose.ImageIndex")));
			this.btnClose.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnClose.ImeMode")));
			this.btnClose.Location = ((System.Drawing.Point)(resources.GetObject("btnClose.Location")));
			this.btnClose.Name = "btnClose";
			this.btnClose.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnClose.RightToLeft")));
			this.btnClose.Size = ((System.Drawing.Size)(resources.GetObject("btnClose.Size")));
			this.btnClose.TabIndex = ((int)(resources.GetObject("btnClose.TabIndex")));
			this.btnClose.Text = resources.GetString("btnClose.Text");
			this.btnClose.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.TextAlign")));
			this.btnClose.Visible = ((bool)(resources.GetObject("btnClose.Visible")));
			this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
			// 
			// btnHelp
			// 
			this.btnHelp.AccessibleDescription = resources.GetString("btnHelp.AccessibleDescription");
			this.btnHelp.AccessibleName = resources.GetString("btnHelp.AccessibleName");
			this.btnHelp.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnHelp.Anchor")));
			this.btnHelp.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnHelp.BackgroundImage")));
			this.btnHelp.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnHelp.Dock")));
			this.btnHelp.Enabled = ((bool)(resources.GetObject("btnHelp.Enabled")));
			this.btnHelp.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnHelp.FlatStyle")));
			this.btnHelp.Font = ((System.Drawing.Font)(resources.GetObject("btnHelp.Font")));
			this.btnHelp.Image = ((System.Drawing.Image)(resources.GetObject("btnHelp.Image")));
			this.btnHelp.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.ImageAlign")));
			this.btnHelp.ImageIndex = ((int)(resources.GetObject("btnHelp.ImageIndex")));
			this.btnHelp.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnHelp.ImeMode")));
			this.btnHelp.Location = ((System.Drawing.Point)(resources.GetObject("btnHelp.Location")));
			this.btnHelp.Name = "btnHelp";
			this.btnHelp.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnHelp.RightToLeft")));
			this.btnHelp.Size = ((System.Drawing.Size)(resources.GetObject("btnHelp.Size")));
			this.btnHelp.TabIndex = ((int)(resources.GetObject("btnHelp.TabIndex")));
			this.btnHelp.Text = resources.GetString("btnHelp.Text");
			this.btnHelp.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.TextAlign")));
			this.btnHelp.Visible = ((bool)(resources.GetObject("btnHelp.Visible")));
			// 
			// lblCycle
			// 
			this.lblCycle.AccessibleDescription = resources.GetString("lblCycle.AccessibleDescription");
			this.lblCycle.AccessibleName = resources.GetString("lblCycle.AccessibleName");
			this.lblCycle.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCycle.Anchor")));
			this.lblCycle.AutoSize = ((bool)(resources.GetObject("lblCycle.AutoSize")));
			this.lblCycle.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCycle.Dock")));
			this.lblCycle.Enabled = ((bool)(resources.GetObject("lblCycle.Enabled")));
			this.lblCycle.Font = ((System.Drawing.Font)(resources.GetObject("lblCycle.Font")));
			this.lblCycle.ForeColor = System.Drawing.Color.Maroon;
			this.lblCycle.Image = ((System.Drawing.Image)(resources.GetObject("lblCycle.Image")));
			this.lblCycle.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCycle.ImageAlign")));
			this.lblCycle.ImageIndex = ((int)(resources.GetObject("lblCycle.ImageIndex")));
			this.lblCycle.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCycle.ImeMode")));
			this.lblCycle.Location = ((System.Drawing.Point)(resources.GetObject("lblCycle.Location")));
			this.lblCycle.Name = "lblCycle";
			this.lblCycle.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCycle.RightToLeft")));
			this.lblCycle.Size = ((System.Drawing.Size)(resources.GetObject("lblCycle.Size")));
			this.lblCycle.TabIndex = ((int)(resources.GetObject("lblCycle.TabIndex")));
			this.lblCycle.Text = resources.GetString("lblCycle.Text");
			this.lblCycle.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCycle.TextAlign")));
			this.lblCycle.Visible = ((bool)(resources.GetObject("lblCycle.Visible")));
			// 
			// lblCCN
			// 
			this.lblCCN.AccessibleDescription = resources.GetString("lblCCN.AccessibleDescription");
			this.lblCCN.AccessibleName = resources.GetString("lblCCN.AccessibleName");
			this.lblCCN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCCN.Anchor")));
			this.lblCCN.AutoSize = ((bool)(resources.GetObject("lblCCN.AutoSize")));
			this.lblCCN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCCN.Dock")));
			this.lblCCN.Enabled = ((bool)(resources.GetObject("lblCCN.Enabled")));
			this.lblCCN.Font = ((System.Drawing.Font)(resources.GetObject("lblCCN.Font")));
			this.lblCCN.ForeColor = System.Drawing.Color.Maroon;
			this.lblCCN.Image = ((System.Drawing.Image)(resources.GetObject("lblCCN.Image")));
			this.lblCCN.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCCN.ImageAlign")));
			this.lblCCN.ImageIndex = ((int)(resources.GetObject("lblCCN.ImageIndex")));
			this.lblCCN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCCN.ImeMode")));
			this.lblCCN.Location = ((System.Drawing.Point)(resources.GetObject("lblCCN.Location")));
			this.lblCCN.Name = "lblCCN";
			this.lblCCN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCCN.RightToLeft")));
			this.lblCCN.Size = ((System.Drawing.Size)(resources.GetObject("lblCCN.Size")));
			this.lblCCN.TabIndex = ((int)(resources.GetObject("lblCCN.TabIndex")));
			this.lblCCN.Text = resources.GetString("lblCCN.Text");
			this.lblCCN.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCCN.TextAlign")));
			this.lblCCN.Visible = ((bool)(resources.GetObject("lblCCN.Visible")));
			// 
			// btnPreviewCycle
			// 
			this.btnPreviewCycle.AccessibleDescription = resources.GetString("btnPreviewCycle.AccessibleDescription");
			this.btnPreviewCycle.AccessibleName = resources.GetString("btnPreviewCycle.AccessibleName");
			this.btnPreviewCycle.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnPreviewCycle.Anchor")));
			this.btnPreviewCycle.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnPreviewCycle.BackgroundImage")));
			this.btnPreviewCycle.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnPreviewCycle.Dock")));
			this.btnPreviewCycle.Enabled = ((bool)(resources.GetObject("btnPreviewCycle.Enabled")));
			this.btnPreviewCycle.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnPreviewCycle.FlatStyle")));
			this.btnPreviewCycle.Font = ((System.Drawing.Font)(resources.GetObject("btnPreviewCycle.Font")));
			this.btnPreviewCycle.Image = ((System.Drawing.Image)(resources.GetObject("btnPreviewCycle.Image")));
			this.btnPreviewCycle.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPreviewCycle.ImageAlign")));
			this.btnPreviewCycle.ImageIndex = ((int)(resources.GetObject("btnPreviewCycle.ImageIndex")));
			this.btnPreviewCycle.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnPreviewCycle.ImeMode")));
			this.btnPreviewCycle.Location = ((System.Drawing.Point)(resources.GetObject("btnPreviewCycle.Location")));
			this.btnPreviewCycle.Name = "btnPreviewCycle";
			this.btnPreviewCycle.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnPreviewCycle.RightToLeft")));
			this.btnPreviewCycle.Size = ((System.Drawing.Size)(resources.GetObject("btnPreviewCycle.Size")));
			this.btnPreviewCycle.TabIndex = ((int)(resources.GetObject("btnPreviewCycle.TabIndex")));
			this.btnPreviewCycle.Text = resources.GetString("btnPreviewCycle.Text");
			this.btnPreviewCycle.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPreviewCycle.TextAlign")));
			this.btnPreviewCycle.Visible = ((bool)(resources.GetObject("btnPreviewCycle.Visible")));
			this.btnPreviewCycle.Click += new System.EventHandler(this.btnPreviewCycle_Click);
			// 
			// btnProcess
			// 
			this.btnProcess.AccessibleDescription = resources.GetString("btnProcess.AccessibleDescription");
			this.btnProcess.AccessibleName = resources.GetString("btnProcess.AccessibleName");
			this.btnProcess.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnProcess.Anchor")));
			this.btnProcess.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnProcess.BackgroundImage")));
			this.btnProcess.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnProcess.Dock")));
			this.btnProcess.Enabled = ((bool)(resources.GetObject("btnProcess.Enabled")));
			this.btnProcess.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnProcess.FlatStyle")));
			this.btnProcess.Font = ((System.Drawing.Font)(resources.GetObject("btnProcess.Font")));
			this.btnProcess.Image = ((System.Drawing.Image)(resources.GetObject("btnProcess.Image")));
			this.btnProcess.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnProcess.ImageAlign")));
			this.btnProcess.ImageIndex = ((int)(resources.GetObject("btnProcess.ImageIndex")));
			this.btnProcess.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnProcess.ImeMode")));
			this.btnProcess.Location = ((System.Drawing.Point)(resources.GetObject("btnProcess.Location")));
			this.btnProcess.Name = "btnProcess";
			this.btnProcess.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnProcess.RightToLeft")));
			this.btnProcess.Size = ((System.Drawing.Size)(resources.GetObject("btnProcess.Size")));
			this.btnProcess.TabIndex = ((int)(resources.GetObject("btnProcess.TabIndex")));
			this.btnProcess.Text = resources.GetString("btnProcess.Text");
			this.btnProcess.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnProcess.TextAlign")));
			this.btnProcess.Visible = ((bool)(resources.GetObject("btnProcess.Visible")));
			this.btnProcess.Click += new System.EventHandler(this.btnProcess_Click);
			// 
			// cboCCN
			// 
			this.cboCCN.AccessibleDescription = resources.GetString("cboCCN.AccessibleDescription");
			this.cboCCN.AccessibleName = resources.GetString("cboCCN.AccessibleName");
			this.cboCCN.AddItemSeparator = ';';
			this.cboCCN.AllowRowSizing = C1.Win.C1List.RowSizingEnum.AllRows;
			this.cboCCN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("cboCCN.Anchor")));
			this.cboCCN.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("cboCCN.BackgroundImage")));
			this.cboCCN.Caption = "";
			this.cboCCN.CaptionHeight = 17;
			this.cboCCN.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
			this.cboCCN.ColumnCaptionHeight = 17;
			this.cboCCN.ColumnFooterHeight = 17;
			this.cboCCN.ComboStyle = C1.Win.C1List.ComboStyleEnum.DropdownList;
			this.cboCCN.ContentHeight = 15;
			this.cboCCN.DeadAreaBackColor = System.Drawing.Color.Empty;
			this.cboCCN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("cboCCN.Dock")));
			this.cboCCN.EditorBackColor = System.Drawing.SystemColors.Window;
			this.cboCCN.EditorFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.cboCCN.EditorForeColor = System.Drawing.SystemColors.WindowText;
			this.cboCCN.EditorHeight = 15;
			this.cboCCN.Enabled = ((bool)(resources.GetObject("cboCCN.Enabled")));
			this.cboCCN.FlatStyle = C1.Win.C1List.FlatModeEnum.System;
			this.cboCCN.Font = ((System.Drawing.Font)(resources.GetObject("cboCCN.Font")));
			this.cboCCN.GapHeight = 2;
			this.cboCCN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("cboCCN.ImeMode")));
			this.cboCCN.ItemHeight = 15;
			this.cboCCN.Location = ((System.Drawing.Point)(resources.GetObject("cboCCN.Location")));
			this.cboCCN.MatchEntryTimeout = ((long)(2000));
			this.cboCCN.MaxDropDownItems = ((short)(5));
			this.cboCCN.MaxLength = 32767;
			this.cboCCN.MouseCursor = System.Windows.Forms.Cursors.Default;
			this.cboCCN.Name = "cboCCN";
			this.cboCCN.PartialRightColumn = false;
			this.cboCCN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("cboCCN.RightToLeft")));
			this.cboCCN.RowDivider.Color = System.Drawing.Color.DarkGray;
			this.cboCCN.RowDivider.Style = C1.Win.C1List.LineStyleEnum.None;
			this.cboCCN.RowSubDividerColor = System.Drawing.Color.DarkGray;
			this.cboCCN.Size = ((System.Drawing.Size)(resources.GetObject("cboCCN.Size")));
			this.cboCCN.TabIndex = ((int)(resources.GetObject("cboCCN.TabIndex")));
			this.cboCCN.Text = resources.GetString("cboCCN.Text");
			this.cboCCN.Visible = ((bool)(resources.GetObject("cboCCN.Visible")));
			this.cboCCN.Enter += new System.EventHandler(this.OnEnterControl);
			this.cboCCN.Leave += new System.EventHandler(this.OnLeaveControl);
			this.cboCCN.PropBag = "<?xml version=\"1.0\"?><Blob><Styles type=\"C1.Win.C1List.Design.ContextWrapper\"><Da" +
				"ta>Group{BackColor:ControlDark;Border:None,,0, 0, 0, 0;AlignVert:Center;}Style2{" +
				"}Style5{}Style4{}Style7{}Style6{}EvenRow{BackColor:Aqua;}Selected{ForeColor:High" +
				"lightText;BackColor:Highlight;}Style3{}Inactive{ForeColor:InactiveCaptionText;Ba" +
				"ckColor:InactiveCaption;}Footer{}Caption{AlignHorz:Center;}Normal{BackColor:Wind" +
				"ow;}HighlightRow{ForeColor:HighlightText;BackColor:Highlight;}Style9{AlignHorz:N" +
				"ear;}OddRow{}RecordSelector{AlignImage:Center;}Heading{Wrap:True;AlignVert:Cente" +
				"r;Border:Raised,,1, 1, 1, 1;ForeColor:ControlText;BackColor:Control;}Style8{}Sty" +
				"le10{}Style11{}Style1{}</Data></Styles><Splits><C1.Win.C1List.ListBoxView AllowC" +
				"olSelect=\"False\" Name=\"\" CaptionHeight=\"17\" ColumnCaptionHeight=\"17\" ColumnFoote" +
				"rHeight=\"17\" VerticalScrollGroup=\"1\" HorizontalScrollGroup=\"1\"><ClientRect>0, 0," +
				" 118, 158</ClientRect><VScrollBar><Width>16</Width></VScrollBar><HScrollBar><Hei" +
				"ght>16</Height></HScrollBar><CaptionStyle parent=\"Style2\" me=\"Style9\" /><EvenRow" +
				"Style parent=\"EvenRow\" me=\"Style7\" /><FooterStyle parent=\"Footer\" me=\"Style3\" />" +
				"<GroupStyle parent=\"Group\" me=\"Style11\" /><HeadingStyle parent=\"Heading\" me=\"Sty" +
				"le2\" /><HighLightRowStyle parent=\"HighlightRow\" me=\"Style6\" /><InactiveStyle par" +
				"ent=\"Inactive\" me=\"Style4\" /><OddRowStyle parent=\"OddRow\" me=\"Style8\" /><RecordS" +
				"electorStyle parent=\"RecordSelector\" me=\"Style10\" /><SelectedStyle parent=\"Selec" +
				"ted\" me=\"Style5\" /><Style parent=\"Normal\" me=\"Style1\" /></C1.Win.C1List.ListBoxV" +
				"iew></Splits><NamedStyles><Style parent=\"\" me=\"Normal\" /><Style parent=\"Normal\" " +
				"me=\"Heading\" /><Style parent=\"Heading\" me=\"Footer\" /><Style parent=\"Heading\" me=" +
				"\"Caption\" /><Style parent=\"Heading\" me=\"Inactive\" /><Style parent=\"Normal\" me=\"S" +
				"elected\" /><Style parent=\"Normal\" me=\"HighlightRow\" /><Style parent=\"Normal\" me=" +
				"\"EvenRow\" /><Style parent=\"Normal\" me=\"OddRow\" /><Style parent=\"Heading\" me=\"Rec" +
				"ordSelector\" /><Style parent=\"Caption\" me=\"Group\" /></NamedStyles><vertSplits>1<" +
				"/vertSplits><horzSplits>1</horzSplits><Layout>Modified</Layout><DefaultRecSelWid" +
				"th>17</DefaultRecSelWidth></Blob>";
			// 
			// txtCycle
			// 
			this.txtCycle.AccessibleDescription = resources.GetString("txtCycle.AccessibleDescription");
			this.txtCycle.AccessibleName = resources.GetString("txtCycle.AccessibleName");
			this.txtCycle.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtCycle.Anchor")));
			this.txtCycle.AutoSize = ((bool)(resources.GetObject("txtCycle.AutoSize")));
			this.txtCycle.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtCycle.BackgroundImage")));
			this.txtCycle.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtCycle.Dock")));
			this.txtCycle.Enabled = ((bool)(resources.GetObject("txtCycle.Enabled")));
			this.txtCycle.Font = ((System.Drawing.Font)(resources.GetObject("txtCycle.Font")));
			this.txtCycle.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtCycle.ImeMode")));
			this.txtCycle.Location = ((System.Drawing.Point)(resources.GetObject("txtCycle.Location")));
			this.txtCycle.MaxLength = ((int)(resources.GetObject("txtCycle.MaxLength")));
			this.txtCycle.Multiline = ((bool)(resources.GetObject("txtCycle.Multiline")));
			this.txtCycle.Name = "txtCycle";
			this.txtCycle.PasswordChar = ((char)(resources.GetObject("txtCycle.PasswordChar")));
			this.txtCycle.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtCycle.RightToLeft")));
			this.txtCycle.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtCycle.ScrollBars")));
			this.txtCycle.Size = ((System.Drawing.Size)(resources.GetObject("txtCycle.Size")));
			this.txtCycle.TabIndex = ((int)(resources.GetObject("txtCycle.TabIndex")));
			this.txtCycle.Text = resources.GetString("txtCycle.Text");
			this.txtCycle.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtCycle.TextAlign")));
			this.txtCycle.Visible = ((bool)(resources.GetObject("txtCycle.Visible")));
			this.txtCycle.WordWrap = ((bool)(resources.GetObject("txtCycle.WordWrap")));
			this.txtCycle.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtCycle_KeyDown);
			this.txtCycle.Validating += new System.ComponentModel.CancelEventHandler(this.txtCycle_Validating);
			// 
			// btnCycle
			// 
			this.btnCycle.AccessibleDescription = resources.GetString("btnCycle.AccessibleDescription");
			this.btnCycle.AccessibleName = resources.GetString("btnCycle.AccessibleName");
			this.btnCycle.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnCycle.Anchor")));
			this.btnCycle.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnCycle.BackgroundImage")));
			this.btnCycle.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnCycle.Dock")));
			this.btnCycle.Enabled = ((bool)(resources.GetObject("btnCycle.Enabled")));
			this.btnCycle.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnCycle.FlatStyle")));
			this.btnCycle.Font = ((System.Drawing.Font)(resources.GetObject("btnCycle.Font")));
			this.btnCycle.Image = ((System.Drawing.Image)(resources.GetObject("btnCycle.Image")));
			this.btnCycle.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnCycle.ImageAlign")));
			this.btnCycle.ImageIndex = ((int)(resources.GetObject("btnCycle.ImageIndex")));
			this.btnCycle.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnCycle.ImeMode")));
			this.btnCycle.Location = ((System.Drawing.Point)(resources.GetObject("btnCycle.Location")));
			this.btnCycle.Name = "btnCycle";
			this.btnCycle.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnCycle.RightToLeft")));
			this.btnCycle.Size = ((System.Drawing.Size)(resources.GetObject("btnCycle.Size")));
			this.btnCycle.TabIndex = ((int)(resources.GetObject("btnCycle.TabIndex")));
			this.btnCycle.Text = resources.GetString("btnCycle.Text");
			this.btnCycle.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnCycle.TextAlign")));
			this.btnCycle.Visible = ((bool)(resources.GetObject("btnCycle.Visible")));
			this.btnCycle.Click += new System.EventHandler(this.btnCycle_Click);
			// 
			// ptbImage
			// 
			this.ptbImage.AccessibleDescription = resources.GetString("ptbImage.AccessibleDescription");
			this.ptbImage.AccessibleName = resources.GetString("ptbImage.AccessibleName");
			this.ptbImage.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("ptbImage.Anchor")));
			this.ptbImage.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("ptbImage.BackgroundImage")));
			this.ptbImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.ptbImage.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("ptbImage.Dock")));
			this.ptbImage.Enabled = ((bool)(resources.GetObject("ptbImage.Enabled")));
			this.ptbImage.Font = ((System.Drawing.Font)(resources.GetObject("ptbImage.Font")));
			this.ptbImage.Image = ((System.Drawing.Image)(resources.GetObject("ptbImage.Image")));
			this.ptbImage.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("ptbImage.ImeMode")));
			this.ptbImage.Location = ((System.Drawing.Point)(resources.GetObject("ptbImage.Location")));
			this.ptbImage.Name = "ptbImage";
			this.ptbImage.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("ptbImage.RightToLeft")));
			this.ptbImage.Size = ((System.Drawing.Size)(resources.GetObject("ptbImage.Size")));
			this.ptbImage.SizeMode = ((System.Windows.Forms.PictureBoxSizeMode)(resources.GetObject("ptbImage.SizeMode")));
			this.ptbImage.TabIndex = ((int)(resources.GetObject("ptbImage.TabIndex")));
			this.ptbImage.TabStop = false;
			this.ptbImage.Text = resources.GetString("ptbImage.Text");
			this.ptbImage.Visible = ((bool)(resources.GetObject("ptbImage.Visible")));
			// 
			// lblVendor
			// 
			this.lblVendor.AccessibleDescription = resources.GetString("lblVendor.AccessibleDescription");
			this.lblVendor.AccessibleName = resources.GetString("lblVendor.AccessibleName");
			this.lblVendor.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblVendor.Anchor")));
			this.lblVendor.AutoSize = ((bool)(resources.GetObject("lblVendor.AutoSize")));
			this.lblVendor.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblVendor.Dock")));
			this.lblVendor.Enabled = ((bool)(resources.GetObject("lblVendor.Enabled")));
			this.lblVendor.Font = ((System.Drawing.Font)(resources.GetObject("lblVendor.Font")));
			this.lblVendor.ForeColor = System.Drawing.Color.Black;
			this.lblVendor.Image = ((System.Drawing.Image)(resources.GetObject("lblVendor.Image")));
			this.lblVendor.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblVendor.ImageAlign")));
			this.lblVendor.ImageIndex = ((int)(resources.GetObject("lblVendor.ImageIndex")));
			this.lblVendor.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblVendor.ImeMode")));
			this.lblVendor.Location = ((System.Drawing.Point)(resources.GetObject("lblVendor.Location")));
			this.lblVendor.Name = "lblVendor";
			this.lblVendor.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblVendor.RightToLeft")));
			this.lblVendor.Size = ((System.Drawing.Size)(resources.GetObject("lblVendor.Size")));
			this.lblVendor.TabIndex = ((int)(resources.GetObject("lblVendor.TabIndex")));
			this.lblVendor.Text = resources.GetString("lblVendor.Text");
			this.lblVendor.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblVendor.TextAlign")));
			this.lblVendor.Visible = ((bool)(resources.GetObject("lblVendor.Visible")));
			// 
			// lblCategory
			// 
			this.lblCategory.AccessibleDescription = resources.GetString("lblCategory.AccessibleDescription");
			this.lblCategory.AccessibleName = resources.GetString("lblCategory.AccessibleName");
			this.lblCategory.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCategory.Anchor")));
			this.lblCategory.AutoSize = ((bool)(resources.GetObject("lblCategory.AutoSize")));
			this.lblCategory.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCategory.Dock")));
			this.lblCategory.Enabled = ((bool)(resources.GetObject("lblCategory.Enabled")));
			this.lblCategory.Font = ((System.Drawing.Font)(resources.GetObject("lblCategory.Font")));
			this.lblCategory.ForeColor = System.Drawing.Color.Black;
			this.lblCategory.Image = ((System.Drawing.Image)(resources.GetObject("lblCategory.Image")));
			this.lblCategory.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCategory.ImageAlign")));
			this.lblCategory.ImageIndex = ((int)(resources.GetObject("lblCategory.ImageIndex")));
			this.lblCategory.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCategory.ImeMode")));
			this.lblCategory.Location = ((System.Drawing.Point)(resources.GetObject("lblCategory.Location")));
			this.lblCategory.Name = "lblCategory";
			this.lblCategory.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCategory.RightToLeft")));
			this.lblCategory.Size = ((System.Drawing.Size)(resources.GetObject("lblCategory.Size")));
			this.lblCategory.TabIndex = ((int)(resources.GetObject("lblCategory.TabIndex")));
			this.lblCategory.Text = resources.GetString("lblCategory.Text");
			this.lblCategory.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCategory.TextAlign")));
			this.lblCategory.Visible = ((bool)(resources.GetObject("lblCategory.Visible")));
			// 
			// lblModel
			// 
			this.lblModel.AccessibleDescription = resources.GetString("lblModel.AccessibleDescription");
			this.lblModel.AccessibleName = resources.GetString("lblModel.AccessibleName");
			this.lblModel.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblModel.Anchor")));
			this.lblModel.AutoSize = ((bool)(resources.GetObject("lblModel.AutoSize")));
			this.lblModel.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblModel.Dock")));
			this.lblModel.Enabled = ((bool)(resources.GetObject("lblModel.Enabled")));
			this.lblModel.Font = ((System.Drawing.Font)(resources.GetObject("lblModel.Font")));
			this.lblModel.ForeColor = System.Drawing.Color.Black;
			this.lblModel.Image = ((System.Drawing.Image)(resources.GetObject("lblModel.Image")));
			this.lblModel.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblModel.ImageAlign")));
			this.lblModel.ImageIndex = ((int)(resources.GetObject("lblModel.ImageIndex")));
			this.lblModel.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblModel.ImeMode")));
			this.lblModel.Location = ((System.Drawing.Point)(resources.GetObject("lblModel.Location")));
			this.lblModel.Name = "lblModel";
			this.lblModel.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblModel.RightToLeft")));
			this.lblModel.Size = ((System.Drawing.Size)(resources.GetObject("lblModel.Size")));
			this.lblModel.TabIndex = ((int)(resources.GetObject("lblModel.TabIndex")));
			this.lblModel.Text = resources.GetString("lblModel.Text");
			this.lblModel.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblModel.TextAlign")));
			this.lblModel.Visible = ((bool)(resources.GetObject("lblModel.Visible")));
			// 
			// lblPartNumber
			// 
			this.lblPartNumber.AccessibleDescription = resources.GetString("lblPartNumber.AccessibleDescription");
			this.lblPartNumber.AccessibleName = resources.GetString("lblPartNumber.AccessibleName");
			this.lblPartNumber.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblPartNumber.Anchor")));
			this.lblPartNumber.AutoSize = ((bool)(resources.GetObject("lblPartNumber.AutoSize")));
			this.lblPartNumber.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblPartNumber.Dock")));
			this.lblPartNumber.Enabled = ((bool)(resources.GetObject("lblPartNumber.Enabled")));
			this.lblPartNumber.Font = ((System.Drawing.Font)(resources.GetObject("lblPartNumber.Font")));
			this.lblPartNumber.ForeColor = System.Drawing.Color.Black;
			this.lblPartNumber.Image = ((System.Drawing.Image)(resources.GetObject("lblPartNumber.Image")));
			this.lblPartNumber.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPartNumber.ImageAlign")));
			this.lblPartNumber.ImageIndex = ((int)(resources.GetObject("lblPartNumber.ImageIndex")));
			this.lblPartNumber.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblPartNumber.ImeMode")));
			this.lblPartNumber.Location = ((System.Drawing.Point)(resources.GetObject("lblPartNumber.Location")));
			this.lblPartNumber.Name = "lblPartNumber";
			this.lblPartNumber.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblPartNumber.RightToLeft")));
			this.lblPartNumber.Size = ((System.Drawing.Size)(resources.GetObject("lblPartNumber.Size")));
			this.lblPartNumber.TabIndex = ((int)(resources.GetObject("lblPartNumber.TabIndex")));
			this.lblPartNumber.Text = resources.GetString("lblPartNumber.Text");
			this.lblPartNumber.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPartNumber.TextAlign")));
			this.lblPartNumber.Visible = ((bool)(resources.GetObject("lblPartNumber.Visible")));
			// 
			// lblPartName
			// 
			this.lblPartName.AccessibleDescription = resources.GetString("lblPartName.AccessibleDescription");
			this.lblPartName.AccessibleName = resources.GetString("lblPartName.AccessibleName");
			this.lblPartName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblPartName.Anchor")));
			this.lblPartName.AutoSize = ((bool)(resources.GetObject("lblPartName.AutoSize")));
			this.lblPartName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblPartName.Dock")));
			this.lblPartName.Enabled = ((bool)(resources.GetObject("lblPartName.Enabled")));
			this.lblPartName.Font = ((System.Drawing.Font)(resources.GetObject("lblPartName.Font")));
			this.lblPartName.ForeColor = System.Drawing.Color.Black;
			this.lblPartName.Image = ((System.Drawing.Image)(resources.GetObject("lblPartName.Image")));
			this.lblPartName.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPartName.ImageAlign")));
			this.lblPartName.ImageIndex = ((int)(resources.GetObject("lblPartName.ImageIndex")));
			this.lblPartName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblPartName.ImeMode")));
			this.lblPartName.Location = ((System.Drawing.Point)(resources.GetObject("lblPartName.Location")));
			this.lblPartName.Name = "lblPartName";
			this.lblPartName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblPartName.RightToLeft")));
			this.lblPartName.Size = ((System.Drawing.Size)(resources.GetObject("lblPartName.Size")));
			this.lblPartName.TabIndex = ((int)(resources.GetObject("lblPartName.TabIndex")));
			this.lblPartName.Text = resources.GetString("lblPartName.Text");
			this.lblPartName.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPartName.TextAlign")));
			this.lblPartName.Visible = ((bool)(resources.GetObject("lblPartName.Visible")));
			// 
			// txtVendor
			// 
			this.txtVendor.AccessibleDescription = resources.GetString("txtVendor.AccessibleDescription");
			this.txtVendor.AccessibleName = resources.GetString("txtVendor.AccessibleName");
			this.txtVendor.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtVendor.Anchor")));
			this.txtVendor.AutoSize = ((bool)(resources.GetObject("txtVendor.AutoSize")));
			this.txtVendor.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtVendor.BackgroundImage")));
			this.txtVendor.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtVendor.Dock")));
			this.txtVendor.Enabled = ((bool)(resources.GetObject("txtVendor.Enabled")));
			this.txtVendor.Font = ((System.Drawing.Font)(resources.GetObject("txtVendor.Font")));
			this.txtVendor.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtVendor.ImeMode")));
			this.txtVendor.Location = ((System.Drawing.Point)(resources.GetObject("txtVendor.Location")));
			this.txtVendor.MaxLength = ((int)(resources.GetObject("txtVendor.MaxLength")));
			this.txtVendor.Multiline = ((bool)(resources.GetObject("txtVendor.Multiline")));
			this.txtVendor.Name = "txtVendor";
			this.txtVendor.PasswordChar = ((char)(resources.GetObject("txtVendor.PasswordChar")));
			this.txtVendor.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtVendor.RightToLeft")));
			this.txtVendor.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtVendor.ScrollBars")));
			this.txtVendor.Size = ((System.Drawing.Size)(resources.GetObject("txtVendor.Size")));
			this.txtVendor.TabIndex = ((int)(resources.GetObject("txtVendor.TabIndex")));
			this.txtVendor.Text = resources.GetString("txtVendor.Text");
			this.txtVendor.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtVendor.TextAlign")));
			this.txtVendor.Visible = ((bool)(resources.GetObject("txtVendor.Visible")));
			this.txtVendor.WordWrap = ((bool)(resources.GetObject("txtVendor.WordWrap")));
			this.txtVendor.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtVendor_KeyDown);
			this.txtVendor.Validating += new System.ComponentModel.CancelEventHandler(this.txtVendor_Validating);
			// 
			// btnVendor
			// 
			this.btnVendor.AccessibleDescription = resources.GetString("btnVendor.AccessibleDescription");
			this.btnVendor.AccessibleName = resources.GetString("btnVendor.AccessibleName");
			this.btnVendor.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnVendor.Anchor")));
			this.btnVendor.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnVendor.BackgroundImage")));
			this.btnVendor.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnVendor.Dock")));
			this.btnVendor.Enabled = ((bool)(resources.GetObject("btnVendor.Enabled")));
			this.btnVendor.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnVendor.FlatStyle")));
			this.btnVendor.Font = ((System.Drawing.Font)(resources.GetObject("btnVendor.Font")));
			this.btnVendor.Image = ((System.Drawing.Image)(resources.GetObject("btnVendor.Image")));
			this.btnVendor.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnVendor.ImageAlign")));
			this.btnVendor.ImageIndex = ((int)(resources.GetObject("btnVendor.ImageIndex")));
			this.btnVendor.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnVendor.ImeMode")));
			this.btnVendor.Location = ((System.Drawing.Point)(resources.GetObject("btnVendor.Location")));
			this.btnVendor.Name = "btnVendor";
			this.btnVendor.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnVendor.RightToLeft")));
			this.btnVendor.Size = ((System.Drawing.Size)(resources.GetObject("btnVendor.Size")));
			this.btnVendor.TabIndex = ((int)(resources.GetObject("btnVendor.TabIndex")));
			this.btnVendor.Text = resources.GetString("btnVendor.Text");
			this.btnVendor.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnVendor.TextAlign")));
			this.btnVendor.Visible = ((bool)(resources.GetObject("btnVendor.Visible")));
			this.btnVendor.Click += new System.EventHandler(this.btnVendor_Click);
			// 
			// txtCategory
			// 
			this.txtCategory.AccessibleDescription = resources.GetString("txtCategory.AccessibleDescription");
			this.txtCategory.AccessibleName = resources.GetString("txtCategory.AccessibleName");
			this.txtCategory.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtCategory.Anchor")));
			this.txtCategory.AutoSize = ((bool)(resources.GetObject("txtCategory.AutoSize")));
			this.txtCategory.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtCategory.BackgroundImage")));
			this.txtCategory.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtCategory.Dock")));
			this.txtCategory.Enabled = ((bool)(resources.GetObject("txtCategory.Enabled")));
			this.txtCategory.Font = ((System.Drawing.Font)(resources.GetObject("txtCategory.Font")));
			this.txtCategory.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtCategory.ImeMode")));
			this.txtCategory.Location = ((System.Drawing.Point)(resources.GetObject("txtCategory.Location")));
			this.txtCategory.MaxLength = ((int)(resources.GetObject("txtCategory.MaxLength")));
			this.txtCategory.Multiline = ((bool)(resources.GetObject("txtCategory.Multiline")));
			this.txtCategory.Name = "txtCategory";
			this.txtCategory.PasswordChar = ((char)(resources.GetObject("txtCategory.PasswordChar")));
			this.txtCategory.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtCategory.RightToLeft")));
			this.txtCategory.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtCategory.ScrollBars")));
			this.txtCategory.Size = ((System.Drawing.Size)(resources.GetObject("txtCategory.Size")));
			this.txtCategory.TabIndex = ((int)(resources.GetObject("txtCategory.TabIndex")));
			this.txtCategory.Text = resources.GetString("txtCategory.Text");
			this.txtCategory.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtCategory.TextAlign")));
			this.txtCategory.Visible = ((bool)(resources.GetObject("txtCategory.Visible")));
			this.txtCategory.WordWrap = ((bool)(resources.GetObject("txtCategory.WordWrap")));
			this.txtCategory.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtCategory_KeyDown);
			this.txtCategory.Validating += new System.ComponentModel.CancelEventHandler(this.txtCategory_Validating);
			// 
			// btnCategory
			// 
			this.btnCategory.AccessibleDescription = resources.GetString("btnCategory.AccessibleDescription");
			this.btnCategory.AccessibleName = resources.GetString("btnCategory.AccessibleName");
			this.btnCategory.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnCategory.Anchor")));
			this.btnCategory.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnCategory.BackgroundImage")));
			this.btnCategory.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnCategory.Dock")));
			this.btnCategory.Enabled = ((bool)(resources.GetObject("btnCategory.Enabled")));
			this.btnCategory.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnCategory.FlatStyle")));
			this.btnCategory.Font = ((System.Drawing.Font)(resources.GetObject("btnCategory.Font")));
			this.btnCategory.Image = ((System.Drawing.Image)(resources.GetObject("btnCategory.Image")));
			this.btnCategory.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnCategory.ImageAlign")));
			this.btnCategory.ImageIndex = ((int)(resources.GetObject("btnCategory.ImageIndex")));
			this.btnCategory.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnCategory.ImeMode")));
			this.btnCategory.Location = ((System.Drawing.Point)(resources.GetObject("btnCategory.Location")));
			this.btnCategory.Name = "btnCategory";
			this.btnCategory.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnCategory.RightToLeft")));
			this.btnCategory.Size = ((System.Drawing.Size)(resources.GetObject("btnCategory.Size")));
			this.btnCategory.TabIndex = ((int)(resources.GetObject("btnCategory.TabIndex")));
			this.btnCategory.Text = resources.GetString("btnCategory.Text");
			this.btnCategory.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnCategory.TextAlign")));
			this.btnCategory.Visible = ((bool)(resources.GetObject("btnCategory.Visible")));
			this.btnCategory.Click += new System.EventHandler(this.btnCategory_Click);
			// 
			// txtModel
			// 
			this.txtModel.AccessibleDescription = resources.GetString("txtModel.AccessibleDescription");
			this.txtModel.AccessibleName = resources.GetString("txtModel.AccessibleName");
			this.txtModel.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtModel.Anchor")));
			this.txtModel.AutoSize = ((bool)(resources.GetObject("txtModel.AutoSize")));
			this.txtModel.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtModel.BackgroundImage")));
			this.txtModel.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtModel.Dock")));
			this.txtModel.Enabled = ((bool)(resources.GetObject("txtModel.Enabled")));
			this.txtModel.Font = ((System.Drawing.Font)(resources.GetObject("txtModel.Font")));
			this.txtModel.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtModel.ImeMode")));
			this.txtModel.Location = ((System.Drawing.Point)(resources.GetObject("txtModel.Location")));
			this.txtModel.MaxLength = ((int)(resources.GetObject("txtModel.MaxLength")));
			this.txtModel.Multiline = ((bool)(resources.GetObject("txtModel.Multiline")));
			this.txtModel.Name = "txtModel";
			this.txtModel.PasswordChar = ((char)(resources.GetObject("txtModel.PasswordChar")));
			this.txtModel.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtModel.RightToLeft")));
			this.txtModel.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtModel.ScrollBars")));
			this.txtModel.Size = ((System.Drawing.Size)(resources.GetObject("txtModel.Size")));
			this.txtModel.TabIndex = ((int)(resources.GetObject("txtModel.TabIndex")));
			this.txtModel.Text = resources.GetString("txtModel.Text");
			this.txtModel.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtModel.TextAlign")));
			this.txtModel.Visible = ((bool)(resources.GetObject("txtModel.Visible")));
			this.txtModel.WordWrap = ((bool)(resources.GetObject("txtModel.WordWrap")));
			this.txtModel.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtModel_KeyDown);
			this.txtModel.Validating += new System.ComponentModel.CancelEventHandler(this.txtModel_Validating);
			// 
			// btnModel
			// 
			this.btnModel.AccessibleDescription = resources.GetString("btnModel.AccessibleDescription");
			this.btnModel.AccessibleName = resources.GetString("btnModel.AccessibleName");
			this.btnModel.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnModel.Anchor")));
			this.btnModel.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnModel.BackgroundImage")));
			this.btnModel.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnModel.Dock")));
			this.btnModel.Enabled = ((bool)(resources.GetObject("btnModel.Enabled")));
			this.btnModel.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnModel.FlatStyle")));
			this.btnModel.Font = ((System.Drawing.Font)(resources.GetObject("btnModel.Font")));
			this.btnModel.Image = ((System.Drawing.Image)(resources.GetObject("btnModel.Image")));
			this.btnModel.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnModel.ImageAlign")));
			this.btnModel.ImageIndex = ((int)(resources.GetObject("btnModel.ImageIndex")));
			this.btnModel.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnModel.ImeMode")));
			this.btnModel.Location = ((System.Drawing.Point)(resources.GetObject("btnModel.Location")));
			this.btnModel.Name = "btnModel";
			this.btnModel.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnModel.RightToLeft")));
			this.btnModel.Size = ((System.Drawing.Size)(resources.GetObject("btnModel.Size")));
			this.btnModel.TabIndex = ((int)(resources.GetObject("btnModel.TabIndex")));
			this.btnModel.Text = resources.GetString("btnModel.Text");
			this.btnModel.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnModel.TextAlign")));
			this.btnModel.Visible = ((bool)(resources.GetObject("btnModel.Visible")));
			this.btnModel.Click += new System.EventHandler(this.btnModel_Click);
			// 
			// txtPartNumber
			// 
			this.txtPartNumber.AccessibleDescription = resources.GetString("txtPartNumber.AccessibleDescription");
			this.txtPartNumber.AccessibleName = resources.GetString("txtPartNumber.AccessibleName");
			this.txtPartNumber.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtPartNumber.Anchor")));
			this.txtPartNumber.AutoSize = ((bool)(resources.GetObject("txtPartNumber.AutoSize")));
			this.txtPartNumber.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtPartNumber.BackgroundImage")));
			this.txtPartNumber.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtPartNumber.Dock")));
			this.txtPartNumber.Enabled = ((bool)(resources.GetObject("txtPartNumber.Enabled")));
			this.txtPartNumber.Font = ((System.Drawing.Font)(resources.GetObject("txtPartNumber.Font")));
			this.txtPartNumber.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtPartNumber.ImeMode")));
			this.txtPartNumber.Location = ((System.Drawing.Point)(resources.GetObject("txtPartNumber.Location")));
			this.txtPartNumber.MaxLength = ((int)(resources.GetObject("txtPartNumber.MaxLength")));
			this.txtPartNumber.Multiline = ((bool)(resources.GetObject("txtPartNumber.Multiline")));
			this.txtPartNumber.Name = "txtPartNumber";
			this.txtPartNumber.PasswordChar = ((char)(resources.GetObject("txtPartNumber.PasswordChar")));
			this.txtPartNumber.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtPartNumber.RightToLeft")));
			this.txtPartNumber.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtPartNumber.ScrollBars")));
			this.txtPartNumber.Size = ((System.Drawing.Size)(resources.GetObject("txtPartNumber.Size")));
			this.txtPartNumber.TabIndex = ((int)(resources.GetObject("txtPartNumber.TabIndex")));
			this.txtPartNumber.Text = resources.GetString("txtPartNumber.Text");
			this.txtPartNumber.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtPartNumber.TextAlign")));
			this.txtPartNumber.Visible = ((bool)(resources.GetObject("txtPartNumber.Visible")));
			this.txtPartNumber.WordWrap = ((bool)(resources.GetObject("txtPartNumber.WordWrap")));
			this.txtPartNumber.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPartNumber_KeyDown);
			this.txtPartNumber.Validating += new System.ComponentModel.CancelEventHandler(this.txtPartNumber_Validating);
			// 
			// btnPartNumber
			// 
			this.btnPartNumber.AccessibleDescription = resources.GetString("btnPartNumber.AccessibleDescription");
			this.btnPartNumber.AccessibleName = resources.GetString("btnPartNumber.AccessibleName");
			this.btnPartNumber.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnPartNumber.Anchor")));
			this.btnPartNumber.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnPartNumber.BackgroundImage")));
			this.btnPartNumber.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnPartNumber.Dock")));
			this.btnPartNumber.Enabled = ((bool)(resources.GetObject("btnPartNumber.Enabled")));
			this.btnPartNumber.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnPartNumber.FlatStyle")));
			this.btnPartNumber.Font = ((System.Drawing.Font)(resources.GetObject("btnPartNumber.Font")));
			this.btnPartNumber.Image = ((System.Drawing.Image)(resources.GetObject("btnPartNumber.Image")));
			this.btnPartNumber.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPartNumber.ImageAlign")));
			this.btnPartNumber.ImageIndex = ((int)(resources.GetObject("btnPartNumber.ImageIndex")));
			this.btnPartNumber.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnPartNumber.ImeMode")));
			this.btnPartNumber.Location = ((System.Drawing.Point)(resources.GetObject("btnPartNumber.Location")));
			this.btnPartNumber.Name = "btnPartNumber";
			this.btnPartNumber.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnPartNumber.RightToLeft")));
			this.btnPartNumber.Size = ((System.Drawing.Size)(resources.GetObject("btnPartNumber.Size")));
			this.btnPartNumber.TabIndex = ((int)(resources.GetObject("btnPartNumber.TabIndex")));
			this.btnPartNumber.Text = resources.GetString("btnPartNumber.Text");
			this.btnPartNumber.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPartNumber.TextAlign")));
			this.btnPartNumber.Visible = ((bool)(resources.GetObject("btnPartNumber.Visible")));
			this.btnPartNumber.Click += new System.EventHandler(this.btnPartNumber_Click);
			// 
			// txtPartName
			// 
			this.txtPartName.AccessibleDescription = resources.GetString("txtPartName.AccessibleDescription");
			this.txtPartName.AccessibleName = resources.GetString("txtPartName.AccessibleName");
			this.txtPartName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtPartName.Anchor")));
			this.txtPartName.AutoSize = ((bool)(resources.GetObject("txtPartName.AutoSize")));
			this.txtPartName.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtPartName.BackgroundImage")));
			this.txtPartName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtPartName.Dock")));
			this.txtPartName.Enabled = ((bool)(resources.GetObject("txtPartName.Enabled")));
			this.txtPartName.Font = ((System.Drawing.Font)(resources.GetObject("txtPartName.Font")));
			this.txtPartName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtPartName.ImeMode")));
			this.txtPartName.Location = ((System.Drawing.Point)(resources.GetObject("txtPartName.Location")));
			this.txtPartName.MaxLength = ((int)(resources.GetObject("txtPartName.MaxLength")));
			this.txtPartName.Multiline = ((bool)(resources.GetObject("txtPartName.Multiline")));
			this.txtPartName.Name = "txtPartName";
			this.txtPartName.PasswordChar = ((char)(resources.GetObject("txtPartName.PasswordChar")));
			this.txtPartName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtPartName.RightToLeft")));
			this.txtPartName.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtPartName.ScrollBars")));
			this.txtPartName.Size = ((System.Drawing.Size)(resources.GetObject("txtPartName.Size")));
			this.txtPartName.TabIndex = ((int)(resources.GetObject("txtPartName.TabIndex")));
			this.txtPartName.Text = resources.GetString("txtPartName.Text");
			this.txtPartName.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtPartName.TextAlign")));
			this.txtPartName.Visible = ((bool)(resources.GetObject("txtPartName.Visible")));
			this.txtPartName.WordWrap = ((bool)(resources.GetObject("txtPartName.WordWrap")));
			this.txtPartName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPartName_KeyDown);
			this.txtPartName.Validating += new System.ComponentModel.CancelEventHandler(this.txtPartName_Validating);
			// 
			// btnPartName
			// 
			this.btnPartName.AccessibleDescription = resources.GetString("btnPartName.AccessibleDescription");
			this.btnPartName.AccessibleName = resources.GetString("btnPartName.AccessibleName");
			this.btnPartName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnPartName.Anchor")));
			this.btnPartName.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnPartName.BackgroundImage")));
			this.btnPartName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnPartName.Dock")));
			this.btnPartName.Enabled = ((bool)(resources.GetObject("btnPartName.Enabled")));
			this.btnPartName.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnPartName.FlatStyle")));
			this.btnPartName.Font = ((System.Drawing.Font)(resources.GetObject("btnPartName.Font")));
			this.btnPartName.Image = ((System.Drawing.Image)(resources.GetObject("btnPartName.Image")));
			this.btnPartName.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPartName.ImageAlign")));
			this.btnPartName.ImageIndex = ((int)(resources.GetObject("btnPartName.ImageIndex")));
			this.btnPartName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnPartName.ImeMode")));
			this.btnPartName.Location = ((System.Drawing.Point)(resources.GetObject("btnPartName.Location")));
			this.btnPartName.Name = "btnPartName";
			this.btnPartName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnPartName.RightToLeft")));
			this.btnPartName.Size = ((System.Drawing.Size)(resources.GetObject("btnPartName.Size")));
			this.btnPartName.TabIndex = ((int)(resources.GetObject("btnPartName.TabIndex")));
			this.btnPartName.Text = resources.GetString("btnPartName.Text");
			this.btnPartName.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPartName.TextAlign")));
			this.btnPartName.Visible = ((bool)(resources.GetObject("btnPartName.Visible")));
			this.btnPartName.Click += new System.EventHandler(this.btnPartName_Click);
			// 
			// MRPRegenerationProcess
			// 
			this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
			this.AccessibleName = resources.GetString("$this.AccessibleName");
			this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
			this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
			this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
			this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
			this.Controls.Add(this.lblVendor);
			this.Controls.Add(this.ptbImage);
			this.Controls.Add(this.btnCycle);
			this.Controls.Add(this.txtCycle);
			this.Controls.Add(this.cboCCN);
			this.Controls.Add(this.btnClose);
			this.Controls.Add(this.btnHelp);
			this.Controls.Add(this.lblCycle);
			this.Controls.Add(this.lblCCN);
			this.Controls.Add(this.btnPreviewCycle);
			this.Controls.Add(this.btnProcess);
			this.Controls.Add(this.lblCategory);
			this.Controls.Add(this.lblModel);
			this.Controls.Add(this.lblPartNumber);
			this.Controls.Add(this.lblPartName);
			this.Controls.Add(this.txtVendor);
			this.Controls.Add(this.btnVendor);
			this.Controls.Add(this.txtCategory);
			this.Controls.Add(this.btnCategory);
			this.Controls.Add(this.txtModel);
			this.Controls.Add(this.btnModel);
			this.Controls.Add(this.txtPartNumber);
			this.Controls.Add(this.btnPartNumber);
			this.Controls.Add(this.txtPartName);
			this.Controls.Add(this.btnPartName);
			this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
			this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
			this.KeyPreview = true;
			this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
			this.MaximizeBox = false;
			this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
			this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
			this.Name = "MRPRegenerationProcess";
			this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
			this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
			this.Text = resources.GetString("$this.Text");
			this.Closing += new System.ComponentModel.CancelEventHandler(this.MRPRegenerationProcess_Closing);
			this.Load += new System.EventHandler(this.MRPRegenerationProcess_Load);
			((System.ComponentModel.ISupportInitialize)(this.cboCCN)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion
		/// <summary>
		/// Form load event :
		///		- Reset form
		///		- Fill defaul data
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void MRPRegenerationProcess_Load(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ".MRPRegenerationProcess_Load()";
			try
			{
				Security objSecurity = new Security();
				this.Name = THIS;
				if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
				{
					this.Close();
					return;
				}

				txtCycle.Text = string.Empty;

				//Load CCN and set default CCN
				UtilsBO boUtils = new UtilsBO();
				DataSet dstCCN = boUtils.ListCCN();
				cboCCN.DataSource = dstCCN.Tables[MST_CCNTable.TABLE_NAME];
				cboCCN.DisplayMember	= MST_CCNTable.CODE_FLD;
				cboCCN.ValueMember		= MST_CCNTable.CCNID_FLD;
				FormControlComponents.PutDataIntoC1ComboBox(cboCCN, dstCCN.Tables[MST_CCNTable.TABLE_NAME],MST_CCNTable.CODE_FLD,MST_CCNTable.CCNID_FLD,MST_CCNTable.TABLE_NAME);
				txtVendor.Tag = string.Empty;
				txtCategory.Tag = string.Empty;
				txtModel.Tag = string.Empty;
				txtPartNumber.Tag = string.Empty;
				if (SystemProperty.CCNID != 0)
				{
					cboCCN.SelectedValue = SystemProperty.CCNID;
				}
				if (intMRPCycleOptionMasterID > 0)
				{
					MRPRegenerationProcessBO boMRPRegenerationProcess = new MRPRegenerationProcessBO();
					MTR_MRPCycleOptionMasterVO voMTR_MRPCycleOptionMaster = (MTR_MRPCycleOptionMasterVO) boMRPRegenerationProcess.GetCycleByMasterID(intMRPCycleOptionMasterID);
					txtCycle.Text = voMTR_MRPCycleOptionMaster.Cycle;
					txtCycle.Tag = voMTR_MRPCycleOptionMaster.MRPCycleOptionMasterID;
					dtmAsOfDate = voMTR_MRPCycleOptionMaster.AsOfDate;
					intPlanHorizon = voMTR_MRPCycleOptionMaster.PlanHorizon;
					btnPreviewCycle.Enabled = true;
				}
				else
					btnPreviewCycle.Enabled = false;
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}
		/// <summary>
		///  It's called by the Thread
		/// </summary>
		private void GenMRPPlanThreadOffLine()
		{
			const string METHOD_NAME = THIS + ".GenMRPPlanThreadOffLine()";
			try
			{
				btnProcess.Enabled = false;
				const string MRP_FLD = "MRP";
				MRPRegenerationProcessBO boMRPRegen = new MRPRegenerationProcessBO();
			
				boMRPRegen.GenMRPPlanOffLine(int.Parse(cboCCN.SelectedValue.ToString()), int.Parse(txtCycle.Tag.ToString()),
					txtVendor.Tag.ToString(), txtCategory.Tag.ToString(), txtModel.Tag.ToString(), txtPartNumber.Tag.ToString());
				string[] strMessage = new string[1];
				strMessage[0] = MRP_FLD;
				PCSMessageBox.Show(ErrorCode.MESSAGE_GENERATED_SUCCESSFULLY, MessageBoxIcon.Information, strMessage);
				ptbImage.Visible = false;
				btnProcess.Enabled = true;
			}
			catch (PCSException ex)
			{
				if (ex.mCode == ErrorCode.MESSAGE_DCP_CONFIG_CALENDAR_FROM_X_TO_Y)
				{
					string[] strMessage = new string[2];
					strMessage[0] = dtmAsOfDate.Year.ToString();
					strMessage[1] = dtmAsOfDate.AddDays(intPlanHorizon).Year.ToString();
					PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error, strMessage);
				}
				else
					PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
				thrNewGen.Interrupt();
				btnProcess.Enabled = true;
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
				thrNewGen.Interrupt();
				btnProcess.Enabled = true;
			}
		}

		/// <summary>
		/// Start the CPO generation process 
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void btnProcess_Click(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnProcess_Click()";
			try
			{
				if (cboCCN.SelectedValue == null)
				{
					PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxIcon.Warning);
					cboCCN.Focus();
					return;
				}
				if (txtCycle.Text.Trim() == string.Empty)
				{
					PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxIcon.Warning);
					txtCycle.Focus();
					return;
				}
				DateTime dtmDBDate = new UtilsBO().GetDBDate();
				dtmDBDate = new DateTime(dtmDBDate.Year, dtmDBDate.Month, dtmDBDate.Day);
				if (dtmAsOfDate < dtmDBDate)
				{
					PCSMessageBox.Show(ErrorCode.MESSAGE_DCP_ASOFDATE_MUST_IN_FUTURE, MessageBoxIcon.Error);
					txtCycle.Focus();
					return;
				}

				ptbImage.Visible = true;
				thrNewGen = new Thread(new ThreadStart(GenMRPPlanThreadOffLine));
				thrNewGen.CurrentCulture = Thread.CurrentThread.CurrentCulture;
				thrNewGen.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
				thrNewGen.Start();
				if (thrNewGen.ThreadState == ThreadState.Stopped || !thrNewGen.IsAlive)
				{
					thrNewGen = null;
				}
			}
			catch (PCSException ex)
			{
				if (ex.mCode == ErrorCode.MESSAGE_DCP_CONFIG_CALENDAR_FROM_X_TO_Y)
				{
					string[] strMessage = new string[2];
					strMessage[0] = dtmAsOfDate.Year.ToString();
					strMessage[1] = dtmAsOfDate.AddDays(intPlanHorizon).Year.ToString();
					PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error, strMessage);
				}
				else
					PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
				btnProcess.Enabled = true;
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
				btnProcess.Enabled = true;
			}
		}

		/// <summary>
		/// Open Cycle Option
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void btnPreviewCycle_Click(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnPreviewCycle_Click()";
			try
			{
				if (txtCycle.Text.Trim() != string.Empty)	
				{
					MRPCycleOption frmCycleOption = new MRPCycleOption(int.Parse(txtCycle.Tag.ToString()), int.Parse(cboCCN.SelectedValue.ToString()), txtCycle.Text.Trim());
					frmCycleOption.ShowDialog();
					txtCycle.Focus();
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		private void btnClose_Click(object sender, EventArgs e)
		{
			this.Close();
		}
		
		/// <summary>
		/// Open search form to select the Cycle
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void btnCycle_Click(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnCycle_Click()";
			try
			{
				Hashtable htbCriterial = new Hashtable();
				if (cboCCN.SelectedValue == null)
				{
					PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_CCN, MessageBoxIcon.Warning);
					cboCCN.Focus();
					return;
				}
				else
				{
					htbCriterial.Add(MTR_MPSCycleOptionMasterTable.CCNID_FLD, cboCCN.SelectedValue);	
				}
				DataRowView drvResult = FormControlComponents.OpenSearchForm(MTR_MRPCycleOptionMasterTable.TABLE_NAME, MTR_MPSCycleOptionMasterTable.CYCLE_FLD, txtCycle.Text.Trim(), htbCriterial, true);
				if (drvResult != null)
				{
					txtCycle.Text = drvResult[MTR_MRPCycleOptionMasterTable.CYCLE_FLD].ToString();
					txtCycle.Tag = drvResult[MTR_MRPCycleOptionMasterTable.MRPCYCLEOPTIONMASTERID_FLD].ToString();
					btnPreviewCycle.Enabled = true;
					dtmAsOfDate = (DateTime) drvResult[MTR_MRPCycleOptionMasterTable.ASOFDATE_FLD];
					if (drvResult[MTR_MRPCycleOptionMasterTable.ASOFDATE_FLD].ToString() != string.Empty)
						if (drvResult[MTR_MRPCycleOptionMasterTable.PLANHORIZON_FLD].ToString() != string.Empty)
						{
							intPlanHorizon = (int) drvResult[MTR_MRPCycleOptionMasterTable.PLANHORIZON_FLD];
						}
						else intPlanHorizon = 0;
				}
				else
				{
					txtCycle.Focus();
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		#region Change backcolor when focus or lost focus
		private void OnEnterControl(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ". OnEnterControl()";
			try
			{
				FormControlComponents.OnEnterControl(sender, e);
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void OnLeaveControl(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ". OnLeaveControl()";
			try
			{
				FormControlComponents.OnLeaveControl(sender, e);
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}
		#endregion


		private void txtCycle_KeyDown(object sender, KeyEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtCycle_KeyDown()";
			try
			{
				if ((e.KeyCode == Keys.F4) && (btnCycle.Enabled))
				{
					btnCycle_Click(btnCycle, new EventArgs());
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		private void MRPRegenerationProcess_Closing(object sender, CancelEventArgs e)
		{
			const string METHOD_NAME = THIS + ".MPSRegenerationProcess_Closed()";
			try
			{
				// ask user to stop the thread
				if (thrNewGen  != null)
				{
					if (thrNewGen.IsAlive || thrNewGen.ThreadState == ThreadState.Running)
					{
						thrNewGen.Suspend(); 
							string[] strMsg = {"MRP"};					
						DialogResult dlgResult = PCSMessageBox.Show(ErrorCode.MESSAGE_PROCESS_IS_RUNNING, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, strMsg);
						switch (dlgResult)
						{
							case DialogResult.Yes:
								// try to stop the thread
								try
								{
									thrNewGen.Interrupt();
								}
								catch (ThreadAbortException ex)
								{
									Logger.LogMessage(ex.Message, METHOD_NAME, Level.DEBUG);
									e.Cancel = false;
								}
								break;
							case DialogResult.No:
								e.Cancel = true;
								thrNewGen.Resume();
								break;
							case DialogResult.Cancel:
								e.Cancel = true;
								thrNewGen.Resume();
								break;
						}
					}
				}
			}
			catch (ThreadAbortException ex)
			{
				Logger.LogMessage(ex.Message, METHOD_NAME, Level.DEBUG);
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void txtCycle_Validating(object sender, CancelEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtCycle_Leave()";
			try
			{
				OnLeaveControl(sender, e);
				if (txtCycle.Text.Trim() == string.Empty)
				{
					btnPreviewCycle.Enabled = false;
					return;
				}
				Hashtable htbCriterial = new Hashtable();
				if (cboCCN.SelectedValue == null)
				{
					PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_CCN, MessageBoxIcon.Warning);
					
					cboCCN.Focus();
					return;
				}
				else
				{
					htbCriterial.Add(MTR_MPSCycleOptionMasterTable.CCNID_FLD, cboCCN.SelectedValue);	
				}
				DataRowView drvResult = FormControlComponents.OpenSearchForm(MTR_MRPCycleOptionMasterTable.TABLE_NAME, MTR_MPSCycleOptionMasterTable.CYCLE_FLD, txtCycle.Text.Trim(), htbCriterial, false);
				if (drvResult != null)
				{
					btnPreviewCycle.Enabled = true;
					txtCycle.Text = drvResult[MTR_MRPCycleOptionMasterTable.CYCLE_FLD].ToString();
					txtCycle.Tag = drvResult[MTR_MRPCycleOptionMasterTable.MRPCYCLEOPTIONMASTERID_FLD].ToString();
					dtmAsOfDate = (DateTime) drvResult[MTR_MRPCycleOptionMasterTable.ASOFDATE_FLD];
					if (drvResult[MTR_MRPCycleOptionMasterTable.ASOFDATE_FLD].ToString() != string.Empty)
						if (drvResult[MTR_MRPCycleOptionMasterTable.PLANHORIZON_FLD].ToString() != string.Empty)
						{
							intPlanHorizon = (int) drvResult[MTR_MRPCycleOptionMasterTable.PLANHORIZON_FLD];
						}
						else intPlanHorizon = 0;
				}
				else 
					e.Cancel = true;
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		private void txtVendor_Validating(object sender, CancelEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtVendor_Validating()";
			try
			{
				if (!txtVendor.Modified) return;
				if (txtVendor.Text.Trim() == string.Empty)
				{
					txtVendor.Tag = string.Empty;
					txtPartNumber.Text = string.Empty;
					txtPartNumber.Tag = string.Empty;
					txtPartName.Text = string.Empty;
					return;
				}
				DataTable dtbData = FormControlComponents.OpenSearchFormForMultiSelectedRow(MST_PartyTable.TABLE_NAME, MST_PartyTable.CODE_FLD, txtVendor.Text, string.Empty, false);
				if (dtbData != null && dtbData.Rows.Count > 0)
				{
					StringBuilder sbID = new StringBuilder();
					foreach (DataRow drowData in dtbData.Rows)
						sbID.Append(drowData[MST_PartyTable.PARTYID_FLD].ToString()).Append(",");
					txtVendor.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][MST_PartyTable.CODE_FLD].ToString();
					txtVendor.Tag = sbID.ToString(0, sbID.Length - 1);
					txtPartNumber.Text = string.Empty;
					txtPartNumber.Tag = string.Empty;
					txtPartName.Text = string.Empty;
				}
				else
					e.Cancel = true;
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void txtVendor_KeyDown(object sender, KeyEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtVendor_KeyDown()";
			try
			{
				if (e.KeyCode == Keys.F4)
					btnVendor_Click(null, null);
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void btnVendor_Click(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnVendor_Click()";
			try
			{
				DataTable dtbData = FormControlComponents.OpenSearchFormForMultiSelectedRow(MST_PartyTable.TABLE_NAME, MST_PartyTable.CODE_FLD, txtVendor.Text, string.Empty, true);
				if (dtbData != null && dtbData.Rows.Count > 0)
				{
					StringBuilder sbID = new StringBuilder();
					foreach (DataRow drowData in dtbData.Rows)
						sbID.Append(drowData[MST_PartyTable.PARTYID_FLD].ToString()).Append(",");
					txtVendor.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][MST_PartyTable.CODE_FLD].ToString();
					txtVendor.Tag = sbID.ToString(0, sbID.Length - 1);
					txtPartNumber.Text = string.Empty;
					txtPartNumber.Tag = string.Empty;
					txtPartName.Text = string.Empty;
				}
				else
					txtVendor.Focus();
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void txtCategory_Validating(object sender, CancelEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtCategory_Validating()";
			try
			{
				if (!txtCategory.Modified) return;
				if (txtCategory.Text.Trim() == string.Empty)
				{
					txtCategory.Tag = string.Empty;
					txtPartNumber.Text = string.Empty;
					txtPartNumber.Tag = string.Empty;
					txtPartName.Text = string.Empty;
					return;
				}
				DataTable dtbData = FormControlComponents.OpenSearchFormForMultiSelectedRow(ITM_CategoryTable.TABLE_NAME, ITM_CategoryTable.CODE_FLD, txtCategory.Text, string.Empty, false);
				if (dtbData != null && dtbData.Rows.Count > 0)
				{
					StringBuilder sbID = new StringBuilder();
					foreach (DataRow drowData in dtbData.Rows)
						sbID.Append(drowData[ITM_CategoryTable.CATEGORYID_FLD].ToString()).Append(",");
					txtCategory.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][ITM_CategoryTable.CODE_FLD].ToString();
					txtCategory.Tag = sbID.ToString(0, sbID.Length - 1);
					txtPartNumber.Text = string.Empty;
					txtPartNumber.Tag = string.Empty;
					txtPartName.Text = string.Empty;
				}
				else
					e.Cancel = true;
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void txtCategory_KeyDown(object sender, KeyEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtCategory_KeyDown()";
			try
			{
				if (e.KeyCode == Keys.F4)
					btnCategory_Click(null, null);
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void btnCategory_Click(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnCategory_Click()";
			try
			{
				DataTable dtbData = FormControlComponents.OpenSearchFormForMultiSelectedRow(ITM_CategoryTable.TABLE_NAME, ITM_CategoryTable.CODE_FLD, txtCategory.Text, string.Empty, true);
				if (dtbData != null && dtbData.Rows.Count > 0)
				{
					StringBuilder sbID = new StringBuilder();
					foreach (DataRow drowData in dtbData.Rows)
						sbID.Append(drowData[ITM_CategoryTable.CATEGORYID_FLD].ToString()).Append(",");
					txtCategory.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][ITM_CategoryTable.CODE_FLD].ToString();
					txtCategory.Tag = sbID.ToString(0, sbID.Length - 1);
					txtPartNumber.Text = string.Empty;
					txtPartNumber.Tag = string.Empty;
					txtPartName.Text = string.Empty;
				}
				else
					txtCategory.Focus();
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void txtModel_Validating(object sender, CancelEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtModel_Validating()";
			try
			{
				if (!txtModel.Modified) return;
				if (txtModel.Text.Trim() == string.Empty)
				{
					txtModel.Tag = string.Empty;
					txtPartNumber.Text = string.Empty;
					txtPartNumber.Tag = string.Empty;
					txtPartName.Text = string.Empty;
					return;
				}
				DataTable dtbData = FormControlComponents.OpenSearchFormForMultiSelectedRow(MODEL_VIEW, ITM_ProductTable.REVISION_FLD, txtModel.Text, string.Empty, false);
				if (dtbData != null && dtbData.Rows.Count > 0)
				{
					StringBuilder sbCode = new StringBuilder();
					foreach (DataRow drowData in dtbData.Rows)
						sbCode.Append("'" + drowData[ITM_ProductTable.REVISION_FLD].ToString() + "'").Append(",");
					txtModel.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : sbCode.ToString(0, sbCode.Length - 1);
					txtModel.Tag = sbCode.ToString(0, sbCode.Length - 1);
					txtPartNumber.Text = string.Empty;
					txtPartNumber.Tag = string.Empty;
					txtPartName.Text = string.Empty;
				}
				else
					e.Cancel = true;
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void txtModel_KeyDown(object sender, KeyEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtVendor_KeyDown()";
			try
			{
				if (e.KeyCode == Keys.F4)
					btnModel_Click(null, null);
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void btnModel_Click(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnVendor_Click()";
			try
			{
				DataTable dtbData = FormControlComponents.OpenSearchFormForMultiSelectedRow(MODEL_VIEW, ITM_ProductTable.REVISION_FLD, txtModel.Text, string.Empty, true);
				if (dtbData != null && dtbData.Rows.Count > 0)
				{
					StringBuilder sbCode = new StringBuilder();
					foreach (DataRow drowData in dtbData.Rows)
						sbCode.Append("'" + drowData[ITM_ProductTable.REVISION_FLD].ToString() + "'").Append(",");
					txtModel.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : sbCode.ToString(0, sbCode.Length - 1);
					txtModel.Tag = sbCode.ToString(0, sbCode.Length - 1);
					txtPartNumber.Text = string.Empty;
					txtPartNumber.Tag = string.Empty;
					txtPartName.Text = string.Empty;
				}
				else
					txtModel.Focus();
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void txtPartNumber_Validating(object sender, CancelEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtPartNumber_Validating()";
			try
			{
				if (!txtPartNumber.Modified) return;
				if (txtPartNumber.Text.Trim() == string.Empty)
				{
					txtPartNumber.Tag = string.Empty;
					txtPartName.Text = string.Empty;
					return;
				}
				string strFilter = ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.CCNID_FLD + "=" + cboCCN.SelectedValue.ToString()
					+ " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.MAKEITEM_FLD + "=0";
				
				if(txtVendor.Tag != null && txtVendor.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.PRIMARYVENDORID_FLD + " IN (" + txtVendor.Tag.ToString() + ")";
				if(txtCategory.Tag != null && txtCategory.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.CATEGORYID_FLD + " IN (" + txtCategory.Tag.ToString() + ")";
				if (txtModel.Tag != null && txtModel.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.REVISION_FLD + " IN (" + txtModel.Tag.ToString() + ")";
				DataTable dtbData = FormControlComponents.OpenSearchFormForMultiSelectedRow(ITM_ProductTable.TABLE_NAME, ITM_ProductTable.CODE_FLD, txtPartNumber.Text, strFilter, false);
				if (dtbData != null && dtbData.Rows.Count > 0)
				{
					StringBuilder sbID = new StringBuilder();
					foreach (DataRow drowData in dtbData.Rows)
						sbID.Append(drowData[ITM_ProductTable.PRODUCTID_FLD].ToString()).Append(",");
					txtPartNumber.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][ITM_ProductTable.CODE_FLD].ToString();
					txtPartNumber.Tag = sbID.ToString(0, sbID.Length - 1);
					txtPartName.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][ITM_ProductTable.DESCRIPTION_FLD].ToString();
				}
				else
					e.Cancel = true;
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void txtPartNumber_KeyDown(object sender, KeyEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtPartNumber_KeyDown()";
			try
			{
				if (e.KeyCode == Keys.F4)
					btnPartNumber_Click(null, null);
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void btnPartNumber_Click(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnPartNumber_Click()";
			try
			{
				string strFilter = ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.CCNID_FLD + "=" + cboCCN.SelectedValue.ToString()
					+ " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.MAKEITEM_FLD + "=0";
				
				if(txtVendor.Tag != null && txtVendor.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.PRIMARYVENDORID_FLD + " IN (" + txtVendor.Tag.ToString() + ")";
				if(txtCategory.Tag != null && txtCategory.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.CATEGORYID_FLD + " IN (" + txtCategory.Tag.ToString() + ")";
				if (txtModel.Tag != null && txtModel.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.REVISION_FLD + " IN (" + txtModel.Tag.ToString() + ")";
				DataTable dtbData = FormControlComponents.OpenSearchFormForMultiSelectedRow(ITM_ProductTable.TABLE_NAME, ITM_ProductTable.CODE_FLD, txtPartNumber.Text, strFilter, true);
				if (dtbData != null && dtbData.Rows.Count > 0)
				{
					StringBuilder sbID = new StringBuilder();
					foreach (DataRow drowData in dtbData.Rows)
						sbID.Append(drowData[ITM_ProductTable.PRODUCTID_FLD].ToString()).Append(",");
					txtPartNumber.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][ITM_ProductTable.CODE_FLD].ToString();
					txtPartNumber.Tag = sbID.ToString(0, sbID.Length - 1);
					txtPartName.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][ITM_ProductTable.DESCRIPTION_FLD].ToString();
				}
				else
					txtPartNumber.Focus();
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void txtPartName_Validating(object sender, CancelEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtPartName_Validating()";
			try
			{
				if (!txtPartName.Modified) return;
				if (txtPartName.Text.Trim() == string.Empty)
				{
					txtPartNumber.Text = string.Empty;
					txtPartNumber.Tag = null;
					txtPartName.Text = string.Empty;
					return;
				}
				string strFilter = ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.CCNID_FLD + "=" + cboCCN.SelectedValue.ToString()
					+ " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.MAKEITEM_FLD + "=0";
				
				if(txtVendor.Tag != null && txtVendor.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.PRIMARYVENDORID_FLD + " IN (" + txtVendor.Tag.ToString() + ")";
				if(txtCategory.Tag != null && txtCategory.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.CATEGORYID_FLD + " IN (" + txtCategory.Tag.ToString() + ")";
				if (txtModel.Tag != null && txtModel.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.REVISION_FLD + " IN (" + txtModel.Tag.ToString() + ")";
				DataTable dtbData = FormControlComponents.OpenSearchFormForMultiSelectedRow(ITM_ProductTable.TABLE_NAME, ITM_ProductTable.CODE_FLD, txtPartNumber.Text, strFilter, false);
				if (dtbData != null && dtbData.Rows.Count > 0)
				{
					StringBuilder sbID = new StringBuilder();
					foreach (DataRow drowData in dtbData.Rows)
						sbID.Append(drowData[ITM_ProductTable.PRODUCTID_FLD].ToString()).Append(",");
					txtPartNumber.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][ITM_ProductTable.CODE_FLD].ToString();
					txtPartNumber.Tag = sbID.ToString(0, sbID.Length - 1);
					txtPartName.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][ITM_ProductTable.DESCRIPTION_FLD].ToString();
				}
				else
					e.Cancel = true;
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void txtPartName_KeyDown(object sender, KeyEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtPartName_KeyDown()";
			try
			{
				if (e.KeyCode == Keys.F4)
					btnPartName_Click(null, null);
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void btnPartName_Click(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnPartName_Click()";
			try
			{
				string strFilter = ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.CCNID_FLD + "=" + cboCCN.SelectedValue.ToString()
					+ " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.MAKEITEM_FLD + "=0";
				
				if(txtVendor.Tag != null && txtVendor.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.PRIMARYVENDORID_FLD + " IN (" + txtVendor.Tag.ToString() + ")";
				if(txtCategory.Tag != null && txtCategory.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.CATEGORYID_FLD + " IN (" + txtCategory.Tag.ToString() + ")";
				if (txtModel.Tag != null && txtModel.Tag.ToString() != string.Empty)
					strFilter += " AND " + ITM_ProductTable.TABLE_NAME + "." + ITM_ProductTable.REVISION_FLD + " IN (" + txtModel.Tag.ToString() + ")";
				DataTable dtbData = FormControlComponents.OpenSearchFormForMultiSelectedRow(ITM_ProductTable.TABLE_NAME, ITM_ProductTable.CODE_FLD, txtPartNumber.Text, strFilter, true);
				if (dtbData != null && dtbData.Rows.Count > 0)
				{
					StringBuilder sbID = new StringBuilder();
					foreach (DataRow drowData in dtbData.Rows)
						sbID.Append(drowData[ITM_ProductTable.PRODUCTID_FLD].ToString()).Append(",");
					txtPartNumber.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][ITM_ProductTable.CODE_FLD].ToString();
					txtPartNumber.Tag = sbID.ToString(0, sbID.Length - 1);
					txtPartName.Text = (dtbData.Rows.Count > 1) ? "Multi Selection" : dtbData.Rows[0][ITM_ProductTable.DESCRIPTION_FLD].ToString();
				}
				else
					txtPartName.Focus();
			}
			catch (PCSException ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}
	}
}
